package com.example.testactivity0330;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import org.jetbrains.annotations.Nullable;

public class AIDLService extends Service {
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        //将接口暴露给客户端
        return iBinder;
    }



    private  IBinder iBinder = new IMyService.Stub(){
        //实现aidl中定义的方法
        @Override
        public int add(int num1, int num2) throws RemoteException {
            return num1 + num2;
        }
    };


}